<template>
	<view class="pages">
		<u-navbar titleStyle="font-size:40rpx;color:#333;font-weight:700" :placeholder='true' title="每周精选"
			:autoBack="true" bgColor="#F2E7DB"></u-navbar>
		<view class="padding32">
			<view class="whiteBox flexJBC mb24" v-for="item in list">
				 <u-image :src="item.image" :lazy-load="true" width="240rpx"
				 	height="240rpx" radius="10rpx">
				 </u-image>
				 <view class="right" style="margin-left: 16rpx;flex: 1;">
				 	<view class="elipes2" >
				 		{{item.product_name}}
				 	</view>
					<view class="flex" style="flex-wrap: wrap">
						<view class="baoyou flex" v-if="indexx<=6" v-for="(itemm,indexx) in item.labelText" style="margin-right: 10rpx;margin-bottom: 3px;">
							{{itemm}} 
						</view>
					</view>
					<view class="flexJBC">
						<view class="flex">
							<view class="homeRed " >
								<text class="fontS24">￥</text>
								<text class="fontS36">{{item.price}}</text>
							</view>
							<view style="text-decoration: line-through;" class="coc fontS24">
								￥{{item.ot_price}}
							</view>
						</view>
						<view class="rightBtn cof elipes1" @click="$my.go('/myPackageA/goodsAndFacton/goodsDetails?id='+item.id)">
							立即购买
						</view>
					</view>
				 </view>
			</view>
		</view>	
	</view>
</template>

<script>
	export default{
		data(){
			return{
				list:[],
				page:1,
				id:0,
			}
		},
		onReachBottom() {
			this.page++;
			this.getList()
		},
		onLoad(option) {
			this.id=option.id
			this.getList()
		},
		methods:{
			getList(){
				this.$my.post('/index/Product/getPlatformTypeProductWeekNew',{page:this.page,limit:10,platform_type_id:this.id}).then(res=>{
					if(res.code==200 && res.data.data.length>0){
						this.list=this.list.concat(res.data.data)
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.right{
		display: flex;
		justify-content: space-between;
		flex-direction: column;
		height:240rpx ;
		.rightBtn{
			height: 62rpx;
			line-height: 62rpx;
			border-radius: 31rpx;
			background: linear-gradient(97.47deg, #FAE1C5 6%, #C89C7B 96.64%);
			padding: 0 28rpx;
		}
	}
	.pages{
		min-height: 100vh;
		background: linear-gradient(180deg, #F2E7DB 0%, #FCF6EA 100%);
	}
	.baoyou{
		height: 36rpx;
		line-height: 36rpx;
		padding: 0 5rpx;
		color: #C89C7A;
		font-size: 22rpx;
		border-radius:6rpx;
		border: 1rpx solid  #C89C7A;
		
	}
	 // .whiteBox{
		//  width: 80%;
	 // }
</style>
